package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    /*
    * 根据openid查找用户是否存在
    * */
    @Select("select * from user where openid = #{openid}")
    User getByOpenId(String openid);

    /*
    * 注册用户
    * */
    void insert(User user);

    /*
    * 根据用户id查询用户
    * */
    @Select("select * from user where id = #{id}")
    User getById(Long id);

    /*
     * 统计指定时间区域内的用户数据
     * */
    Integer countByMap(Map map);
}
